﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RSRenderer.Core
{
    public class RenderEngine
    {
        /// <summary>
        /// Get the radiance seen through a particular pixel
        /// </summary>
        /// <param name="istate">intersection state for ray tracing
        /// </param>
        /// <param name="rx">pixel x coordinate
        /// </param>
        /// <param name="ry">pixel y coordinate
        /// </param>
        /// <param name="lensU">DOF sampling variable
        /// </param>
        /// <param name="lensV">DOF sampling variable
        /// </param>
        /// <param name="time">motion blur sampling variable
        /// </param>
        /// <param name="instance">QMC instance seed
        /// </param>
        /// <returns> a shading state for the intersected primitive, or
        /// <code>null</code> if nothing is seen through the specifieFd
        /// point
        /// </returns>
        //public virtual ShadingState ComputeRadiance(IntersectionState istate, float rx, float ry, double lensU, double lensV, double time, int instance)
        //{
        //    if (bakingPrimitives == null)
        //    {
        //        Ray r = camera.getRay(rx, ry, imageWidth, imageHeight, lensU, lensV, time);
        //        return r != null ? lightServer.getRadiance(rx, ry, instance, r, istate) : null;
        //    }
        //    else
        //    {
        //        Ray r = new Ray(rx / imageWidth, ry / imageHeight, -1, 0, 0, 1);
        //        traceBake(r, istate);
        //        if (!istate.hit())
        //            return null;
        //        ShadingState state = ShadingState.createState(istate, rx, ry, r, instance, lightServer);
        //        bakingPrimitives.prepareShadingState(state);
        //        if (bakingViewDependent)
        //            state.setRay(camera.getRay(state.Point));
        //        else
        //        {
        //            Point3 p = state.Point;
        //            Vector3 n = state.Normal;
        //            // create a ray coming from directly above the point being
        //            // shaded
        //            Ray incoming = new Ray(p.x + n.x, p.y + n.y, p.z + n.z, -n.x, -n.y, -n.z);
        //            incoming.Max = 1;
        //            state.setRay(incoming);
        //        }
        //        lightServer.shadeBakeResult(state);
        //        return state;
        //    }
        //}
    }
}
